#!/sbin/openrc-run
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

command="/usr/bin/gerbera"
command_args="--logfile ${GERBERA_LOGFILE}
	      --config ${GERBERA_CONFIG}
	      --port ${GERBERA_PORT}
	      ${GERBERA_OPTIONS}"
command_user="gerbera:gerbera"
command_background=true
start_stop_daemon_args="--wait 500"
retry="10"
pidfile="/run/${RC_SVCNAME}.pid"

depend() {
	need net
}

start_pre() {
	checkpath --owner "gerbera:gerbera" \
			  --mode 0644 \
			  --file "${GERBERA_LOGFILE}"
}
